<?php

require_once('nusoap.php');

function sendsms($mobile, $content)
{
    $client = new nusoap_client("http://121.199.48.186:1210/services/msgsend.asmx?wsdl", true);
    //设置编码，为UTF-8，以下三个设置不可缺少
    $client->soap_defencoding = 'UTF-8';
    $client->decode_utf8 = false;
    $client->xml_encoding = 'UTF-8';

    /*
      account 账户名
      pwd 密码
     */
    $param = array('Channel' => '', 'DesNo' => $mobile, 'Msg' => $content, 'userCode' => 'txws', 'userPass' => 'txws2233');
    $result = $client->call('SendMsg', $param);
    // $param = array('userCode'=>'txws','userPass'=>'123@txws');
    // $result=$client->call('GetBalance',$param);
    //检查错误，获取返回值
    if (!$err = $client->getError())
    {
        return serialize($result);
    }
    else
    {
        return $err;
    }
}

//群发
function sendmes($mobile, $content)
{
    $client = new nusoap_client("http://yes.itissm.com/api/MsgSend.asmx?wsdl", true);
    //设置编码，为UTF-8，以下三个设置不可缺少
    $client->soap_defencoding = 'UTF-8';
    $client->decode_utf8 = false;
    $client->xml_encoding = 'UTF-8';

    /*
      account 账户名
      pwd 密码
     */
    $param = array('Channel' => '87', 'DesNo' => $mobile, 'Msg' => $content, 'userCode' => 'txwsgg', 'userPass' => 'txws1688');
    $result = $client->call('sendMes', $param);
    // $param = array('userCode'=>'txws','userPass'=>'123@txws');
    // $result=$client->call('GetBalance',$param);
    //检查错误，获取返回值
    if (!$err = $client->getError())
    {
        return serialize($result);
    }
    else
    {
        return $err;
    }
}
